#include <iostream>
#define N 100

using namespace std;


void read_matrix(int matrix[N][N], int row, int column){
int i, j;
for (i=0;i<row;i++)
    for(j=0;j<column;j++){
        cout<<"m["<<i<<"]["<<j<<"]= ";
        cin>>matrix[i][j];}
}


int main(){
int row;
int column;
int matrix[N][N];
int i,j;
int sum=0;
int prod=1;


cout<<"Type the number of rows: " ;
cin>>row;

cout<<"Type the number of columns: " ;
cin>>column;

read_matrix(matrix, row, column);

for(i=0;i<row;++i){
    for(j=0;j<column;++j){
        if(i<j){
            sum += matrix[i][j];}
        if(i>j){
            prod *= matrix[i][j];}
    }
}

cout<<"The sum of the elements above the diagonal is: " << sum<<endl;
cout<<"The product of the elements below the diagonal is: "<<prod<<endl;

return 0;
}
